<{include file="shop_header.htm"}>
<style type="text/css">
.content4 li{
	height:190px;
}
</style>
<script type="text/javascript">
function getfav()
{	
	var url = '<{$config.weburl}>/ajax_back_end.php';
	var myurl='<{$config.weburl}>/?m=product%26s=product_detail%26id=<{$smarty.get.id}>';
	var u='<{$smarty.cookies.USER}>';
	if(u=='')
	{
		alert('<{$lang.no_logo}>');
		window.location.href='<{$config.weburl}>/login.php?forward=?m=product&s=product_detail&id=<{$smarty.get.id}>';
		return false;
	}
	var fu='<{$smarty.get.id}>';
	var typ='3';
	var ttil="<{$prod.pname|regex_replace:"/[\r\t\n]/":""}>";
	var mpic='<{$config.weburl}>/uploadfile/zsimg/<{$prod.showimg}>.jpg';
	var des="<{$prod.pname|strip_tags}>";
	var pars = 'user='+u+'&fid='+fu+'&type='+typ+'&title='+ttil+'&url='+myurl+'&des='+des+'&picurl='+mpic;
	var myAjax = new Ajax.Request(url,{method: 'post', parameters: pars, onComplete: showResponse});
	function showResponse(originalRequest)
	{
		if(originalRequest.responseText>1)
			alert('<{$lang.fav_ok}>');
		else if (originalRequest.responseText>0)
			alert('<{$lang.fav_isbing}>');
		else
			alert('<{$lang.error}>');
	}
}
function get_same_pro(prov)
{	
	var myurl = '<{$config.weburl}>/ajax_back_end.php';
	var sj = new Date();
    var pars = 'sj='+sj+'&province='+prov+'&catid='+<{$prod.catid}>+'&gettype=sameoffer';
	var myAjax = new Ajax.Request(myurl,{method: 'post', parameters: pars, onComplete: showResponse});
	function showResponse(originalRequest)
	{
	    if(originalRequest.responseText!='')
	       $('pro_list').innerHTML=originalRequest.responseText;
	}
}
function seebig(url,id)
{
	if(url=='')
		return;
	url = url.substr(0,url.lastIndexOf('/')+1)+'big_'+url.substr(url.lastIndexOf('/')+1);
    $('imgmove').innerHTML='<a href="<{$config.weburl}>/uploadfile/product/'+url+'" target="_blank">'+
	'<img id="img'+id+'" border="0" src="<{$config.weburl}>/uploadfile/product/'+url+'" ></a>';
	if($('img'+id).height>$('img'+id).width)
		$('img'+id).height=280;
	else
		$('img'+id).width=280;
}
var weburl='<{$config.weburl}>';
function copyToClipboard(txt)
{
	try{
		window.clipboardData.setData("Text",txt);  
		alert('<{$lang.copysuc}>'); 
	}
	catch(e){alert('<{$lang.noace}>');}
}
</script>
<script src="<{$config.weburl}>/script/my_lightbox.js" language="javascript"></script>
<div class="menu_bottom L1">				
    <div class="headtop_L">
       <{$lang.you_here}>&raquo;<a href='<{$config.weburl}>/'><{$lang.home}></a>&raquo;<a href="<{$config.weburl}>/?m=product"><{$lang.shop}></a> &raquo;<{$guide}>
    </div>	
</div>

<div id="mainbody1" class="m1">
<div class="leftbar">

	<div class="title4"><div class="title_left2 L2"><{$lang.pro_det}></div></div>
    <div class="content4">
	<div class="newstitle"><{$prod.pname}></div> 
    <div class="newstime">
    【<{$lang.read_num}><{$prod.read_nums}> <{insert name="label" type="statics" temp='statics_default' ctype=3 id=$prod.id}>】
    </div>
			<div class="propic">
			    <div id="imgmove" class="imgmove">       						 
                 	 <{assign var=img value=$prod.cover}>
                     <{html_image file=uploadfile/product/$img width=280 alt=$list.pname}>
				 </div>
                 
				 <div id="infopic" class="small_pic">
				  <{foreach item=pic key=num from=$prod.pic}>
						<{if $pic&&$num<4}>
						 <img onMouseOver="seebig('<{$pic}>',<{$num}>)" style="cursor:pointer" src="<{$config.weburl}>/uploadfile/product/<{$pic}>" border=0 width="45" height="40">
						<{/if}>
				 <{/foreach}>
				</div>
                <div style="padding:8px;overflow:hidden;">
                    <a href="javascript:alertWin('<{$lang.share}>','<br><span style=width:80px;><{$lang.purl}></span><input id=textfield type=text size=45 value=<{$config.weburl}>/?m=product&s=product_detail&id=<{$prod.id}>>
                    <div style=width:340px;padding-left:60px;text-align:left;><br><button onclick=copyToClipboard(\'<{$config.weburl}>/?m=product&s=product_detail&id=<{$prod.id}>\')><{$lang.copysend}></button></div>',400,120,'');"><img src="<{$config.weburl}>/image/<{$config.temp}>/add_to_share.png" /></a>
                    <a href="javascript:getfav();"><img src="<{$config.weburl}>/image/<{$config.temp}>/add_to_fav.png" /></a>
                </div>
			</div>
			<div class="proinfo">
            <form action="<{$config.weburl}>" method="get">
			<table width="330" border="0">
			     <tr>
					 <td class="pro_text">市场价</td>
					 <td><{$config.money}> <span style="text-decoration:line-through"><{$prod.market_price|number_format:2}></span> <{$prod.unit}></td>
				 </tr>
				<{if $prod.price>0}>
            	<tr>
					 <td class="pro_text">网销价格</td>
					 <td><{$config.money}> <span style="color:#FF5500; font-size:24px;"><{$prod.price|number_format:2}></span> <{$prod.unit}></td>
				 </tr>
				 <{/if}>
                 <tr>
					<td width="97" class="pro_text"><{$lang.freight}></td>
					<td width="223">
                    <{if $prod.freight_type==1}>
                    	<{$lang.sell_freight}>
                    <{else}>
                    	<{$lang.sent_by_post}><{$prod.freight.0}> <{$lang.exp}><{$prod.freight.1}> <{$lang.ems}><{$prod.freight.2}>
                    <{/if}>
                    </td>
				 </tr>
                <tr>
					<td width="97" class="pro_text"><{$lang.have_sell}></td>
					<td width="223"><{$prod.sell_amount}> <{$prod.unit}></td>
				 </tr>
				 <tr>
					<td width="97" class="pro_text"><{$lang.brand}></td>
					<td width="223"><{$prod.pp}></td>
				 </tr>
				 <tr>
					<td class="pro_text"><{$lang.pard}></td>
					<td><{$prod.gg}></td>
				 </tr>
				 <tr>
					<td class="pro_text"><{$lang.model}></td>
					<td><{$prod.model}></td>
				 </tr>
                 <tr>
					 <td class="pro_text"><{$lang.ptype}></td>
					 <td><{$prod.ptype}></td>
				 </tr>
                 <tr>
					 <td class="pro_text"><{$lang.pro_city}></td>
					 <td><{$prod.province}> <{$prod.city}></td>
				 </tr>
                 <tr>
					 <td class="pro_text"><{$lang.ptime}></td>
					 <td><{$prod.uptime|date_format}></td>
				 </tr>
				<tr>
				 <td class="pro_text"><{$lang.trd_type}></td>
				 <td><{$prod.trade_type}></td>
				 </tr>
				 <td colspan="2">
                <{if $isbuy==0&&$prod.price*1>0&&$prod.have_time>0}>
                 <div style="background-color:#FFF3D9; border:1px solid #FEE2A1; padding:5px; line-height:25px;">
					 <{if $prod.have_time!=6}>
					 <{$lang.time_left}>: <span id="endtime"><{$prod.have_time}></span><br />
					 <{/if}>
                 <{$lang.nums}>
                 <input onkeyup="check_nums();" size="5" name="nums" id="nums" type="text" value="1" /> <{$prod.unit}>(<{$lang.stock}><{$prod.amount}><{$prod.unit}>)
                 <input name="id" type="hidden" value="<{$prod.id}>" />
				 <input name="m" type="hidden" value="product" />
				 <input name="s" type="hidden" value="order" />
                 <br />

                 <input type="image" src="<{$config.weburl}>/image/<{$config.temp}>/buy.gif" />
                 <a href="<{$config.weburl}>/shop.php?uid=<{$prod.userid}>&action=mail&tid=<{$prod.id}>&contype=1&title=<{$prod.pname}>">
                 <img src="<{$config.weburl}>/image/<{$config.temp}>/sendmail.gif" />
                 </a>
                 </div>
				<script>
				var CID = "endtime";
				if(window.CID != null)
				{
					var iTime = document.getElementById(CID).innerHTML;
					var Account;
					RemainTime();
				}
				function RemainTime()
				{
					var iDay,iHour,iMinute,iSecond;
					var sDay="",sHour="",sMinute="",sSecond="",sTime="";
					if (iTime >= 0)
					{
						iDay = parseInt(iTime/24/3600);
						if (iDay > 0)
							sDay = iDay + "<{$lang.day}>";
						iHour = parseInt((iTime/3600)%24);
						if (iHour > 0)
							sHour = iHour + "<{$lang.hour}>";
						iMinute = parseInt((iTime/60)%60);
						if (iMinute > 0)
							sMinute = iMinute + "<{$lang.minute}>";
						iSecond = parseInt(iTime%60);
						if (iSecond >= 0)
							sSecond = iSecond + "<{$lang.second}>";
						
						if ((sDay=="")&&(sHour==""))
							sTime="<span style='color:darkorange'>" + sMinute+sSecond + "</font>";
						else
							sTime=sDay+sHour+sMinute+sSecond;
						if(iTime==0)
						{
							clearTimeout(Account);
							sTime="<span style='color:green'><{$lang.timeisend}></span>";
						}
						else
							Account = setTimeout("RemainTime()",1000);
						iTime=iTime-1;
					}
					else
						sTime="<span style='color:red'><{$lang.countdownisend}></span>";
					document.getElementById(CID).innerHTML = sTime;
				}
				 function check_nums()
				 {
				 	var v=$('nums').value*1;
				 	if(!v)
						$('nums').value=1;
					if(v><{$prod.amount}>*1)
					{
						$('nums').value=<{$prod.amount}>*1;
						return false;
					}
				 }
				 </script>
                 <{else}>
                 <a href="<{$config.weburl}>/shop.php?uid=<{$prod.userid}>&action=mail&tid=<{$prod.id}>&contype=1&title=<{$prod.pname}>">
                 <img src="<{$config.weburl}>/image/<{$config.temp}>/sendmail.gif" />
                 </a>
                 <{/if}>
                 </td>
				 </tr>
			</table>
            </form>
			</div>
            <div class="clear"></div>
 			<div class="prodetail" id="productdetail">
            <div class="pro_int"><{$lang.pro_det}></div>
				<div style="float:right; width:250px; margin-right:5px;"><script src='<{$config.weburl}>/api/ad.php?id=12&catid=<{$smarty.get.id}>&sname=<{$sname}>'></script></div>
                <{if $addfieldlist}>
                     <{foreach item=fieldlist from=$addfieldlist}>
                        <div>
                        <span class="pro_text" style="width:100px;"><{$fieldlist.catInfo}>:</span> 
                        <{$fieldlist.fieldvalue}>
                        </div> 
                    <{/foreach}>
                <{/if}>
                <{$prod.detail}>  
			</div>
			<{insert name="label" type="comment" ctype=3 cid=$smarty.get.id temp="comment_default" }>
            </div>
            <div class="bottom4"></div>
			
			<div class="m1">
				<div class="title4">
					<h2><{$lang.com_newpro}></h2>
                    <span style="float:right; margin-right:20px;">
                    	<a href="<{$config.weburl}>/shop.php?uid=<{$prod.userid}>&action=prolist"><{$lang.more}></a>
                    </span>
				</div>
				<div class="samepro content4">
                	<ul>
					<{foreach item=slist from=$relpro}>
					<li>
					<a href="<{geturl type='prod' user=$slist.user uid=$slist.userid tid=$slist.id}>">
					<{assign var="img" value=$slist.img}>
					<{html_image file=uploadfile/product/$img width=115 alt=$list.pname}><br />
					<{$slist.pname|truncate:16}><span class="bmoney">
					<{$config.money}> <{$slist.price|number_format:2}></span>
					</a>
					</li>
					<{/foreach}>
                    </ul>
                    <div class="clear"></div>
				</div>
			</div>
</div>
<!--右边开始-->	

<div class="rightbar">
	 <div class="right1">
		<div class="sectitle" ><div class="title_left1 L2"><{$lang.seller_det}></div></div>
		 
		<div class="seccon">
		<table width="100%" border="0" style="margin-left:5px;"cellspacing="0">
		  <tr height="22">
			<td colspan="2">
			<b><a href="<{geturl type='' user=$cominfo.user uid=$cominfo.userid}>"><{$cominfo.company}></a></b>
			
			</td>
		  </tr>
		   <tr height="22">
			<td colspan="2"> 
				<{if $cominfo.business}>
					 <img src="<{$config.weburl}>/image/default/check_right.gif" /><{$lang.pass_th}>
				 <{else}>
					<img src="<{$config.weburl}>/image/default/no_right.gif" /><{$lang.not_pass}>
				 <{/if}>
			   </td>
		  </tr>
		  <tr height="22">
			<td width="80"><{$lang.user_g}></td>
			<td width="*"><{$cominfo.grouplogo}>&nbsp;&nbsp;[<a href="<{$config.weburl}>/main.php?menu=user&action=m&m=friend&s=admin_friends&friendid=<{$cominfo.userid}>"><{$lang.add_friend}></a>]</td>
		  </tr>
		  <tr height="22">
			<td><{$lang.cont}></td>
			<td><{$cominfo.contact}>  <{if $cominfo.qq!=''}>
				 <a href="tencent://message/?uin=<{$cominfo.qq}>&Site=<{$config.weburl}>&Menu=yes">
				 <img align="absmiddle" border="0" src="http://wpa.qq.com/pa?p=1:<{$cominfo.qq}>:4" /></a>
				 <{/if}>

				<{if $cominfo.msn!=''}>
				<a href="msnim:chat?contact=<{$cominfo.msn}>">
				<img align="absmiddle" src="<{$config.weburl}>/image/default/ico_msn.gif" width="16" height="16"/></a>
				<{/if}>

				<{if $cominfo.skype!=''}>
				<a href="skype:<{$cominfo.skype}>?call">
				<img align="absmiddle" border="0" src="<{$config.weburl}>/image/default/skypeonline.png"></a>
				<{/if}></td>
		  </tr>
		  <tr height="22">
			<td><{$lang.tel}></td>
			<td><{$cominfo.tel}></td>
		  </tr>
		  <tr height="22">
			<td><{$lang.fax}></td>
			<td><{$cominfo.fax}></td>
		  </tr>
		  <tr height="22">
			<td><{$lang.mobile}></td>
			<td><{$cominfo.mobile}></td>
		 <tr height="22">
			<td><{$lang.city}></td>
			<td><{$cominfo.province}><{$cominfo.city}></td>
		  </tr>
		  <tr height="22">
			<td><{$lang.addr}></td>
			<td><{$cominfo.addr}></td>
		  </tr>
		</table>
	   </div>
		<div class="clear"></div>
	</div>
	<div class="right1 m1">
		<div class="sectitle" >
			<div class="title_left1 L2"><{$lang.same_pro}></div>
			<div class="more" style="margin-top:3px;">
			<select onchange="get_same_pro(this.value)" name="province">
			<option value="0"><{$lang.allcity}></option><{$province}></select>
			</div>
		</div>
		 <div class="seccon" id="pro_list">
			<table width="100%" border="0" cellspacing="0" cellpadding="0">
			<{foreach item=list from=$samepro}>
			  <tr>
				<td>
					<a href="<{geturl type='prod' user=$list.user uid=$list.userid tid=$list.id}>">
					<b><{$list.pname|truncate:20:"...":true}></b>
					</a>
				</td>
				<td width="50">[<{$list.province}>]</td>
			  </tr>
			   <tr>
				<td colspan="2" class="line">
				<{$list.company|truncate:24:"...":true}><br /><{$list.tel}>
				</td>
			  </tr>
			 <{/foreach}>
			</table>
		</div>
		</div>
</div>		
</div>
<{include file="shop_footer.htm"}>